package com.bstek.demo.esasyules;

import org.jeasy.rules.annotation.Action;
import org.jeasy.rules.annotation.Condition;
import org.jeasy.rules.annotation.Fact;
import org.jeasy.rules.annotation.Rule;
import org.jeasy.rules.api.Facts;

/**
 * 女性检查规则
 */
@Rule(name = "Female rule", description = "性别检查")
public class FemaleRule {
    @Condition
    public boolean when(@Fact("person")Person person) {
        System.out.println("when Female rule");
        return person.getSex().equals("女");
    }

    @Action
    public void then(Facts facts) {
        facts.put("result","我是女人");
    }
}
